<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});
Auth::routes();
Route::get('logout', 'App\Http\Controllers\Auth\LoginController@logout');
Route::group(['prefix' => 'home', 'namespace' => 'App\Http\Controllers', 'middleware' => 'auth'], function () {

    Route::get('/', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
    //主导航
    Route::get('/getnav', [App\Http\Controllers\HomeController::class, 'navMenu'])->name('navMenu');
    //左导航
    Route::get('/sideBarMenu/{id}', [App\Http\Controllers\HomeController::class, 'sideBarMenu'])->name('sideBarMenu');
});

Route::any('/DingTalkInterface/{action}/{name}', [App\Http\Controllers\DingTalk\InterfaceController::class, "action"])
    ->where('action', 'robot|login|oauthqrcode|oauth|server|connect');


Route::any('{path}', function () {
    return makeAction();
})->where('path', '.*')->middleware(['auth', 'Permission']);
